<?php $this->load->view("general/header");?>
<div id="customer" class="page_">
    <div class="form">              
        <div class="form_header"><a href="<?php echo site_url('driver/view');?>">Lihat Daftar Supir</a> &rarr; <a href="<?php echo site_url('driver/edit/' . $id);?>">Ubah Data Supir</a></div>
        
        <div class="content_dataS">
        <form method="post" action="<?php echo site_url("driver/edit/" . $id);?>">
           	<div class="content_dataR">
           		<div class="row">
                    <div class="col1"></div>
                    
                </div>
                <div class="row">
                    <div class="col1"></div>
                    
                </div>
                
           		
              
                <div class="row">
                    <div class="col1">Kontak Emergency</div>
                    <div class="col2"><input type="text" name="emerkontak"  value="<?php echo $driverDet['0']['emerkontak'];?>"/> 
                        <div class="errorField"><?php echo form_error("emerkontak");?></div>
                    </div>
                </div>
                <div class="row">
                    <div class="col1">Telepon Emergency</div>
                    <div class="col2"><input type="text" name="emertelp"  value="<?php echo $driverDet['0']['emertelp'];?>"/> 
                        <div class="errorField"><?php echo form_error("emertelp");?></div>
                    </div>
                </div>
                <div class="row">
                    <div class="col1">No KTP</div>
                    <div class="col2"><input type="text" name="no_ktp" value="<?php echo $driverDet['0']['no_ktp'];?>"/> 
                        <div class="errorField"><?php echo form_error("no_ktp");?></div>
                    </div>
                </div>
                <div class="row">
                    <div class="col1">Umur</div>
                    <div class="col2"><input type="text" name="umur" value="<?php echo $driverDet['0']['umur'];?>" /> 
                        <div class="errorField"><?php echo form_error("umur");?></div>
                    </div>
                </div>
                
                <div class="row">
                    <div class="col1">Tarif/hari *</div>
                    <div class="col2"><input type="text" name="gaji"  style="text-align:right" value="<?php foreach($price as $price1){
																				if($price1['keterangan']=="Harian"){
																					echo $price1['harga'];
																				}
																			 }?>""/> 
                        <div class="errorField"><?php echo form_error("gaji");?></div>
                </div>
                <div class="row">
                    <div class="col1">Tarif Mingguan</div>
                    <div class="col2"><input type="text" name="tarifminggu" style="text-align:right" value="<?php foreach($price as $price1){
																				if($price1['keterangan']=="Mingguan"){
																					echo $price1['harga'];
																				}
																			 }?>"/> 
                        <div class="errorField"><?php echo form_error("tarif");?></div>
                	</div>
                </div>
                <div class="row">
                    <div class="col1">Tarif Bulanan</div>
                    <div class="col2"><input type="text" name="tarifbulan" style="text-align:right" value="<?php foreach($price as $price1){
																				if($price1['keterangan']=="Bulanan"){
																					echo $price1['harga'];
																				}
																			 }?>"/> 
                        <div class="errorField"><?php echo form_error("tarif");?></div>
                    </div>
                </div>
                <div class="row">
                    <div class="col1">Tarif 6 Bulanan</div>
                    <div class="col2"><input type="text" name="tarif6bulan" style="text-align:right" value="<?php foreach($price as $price1){
																				if($price1['keterangan']=="6 Bulanan"){
																					echo $price1['harga'];
																				}
																			 }?>"/> 
                        <div class="errorField"><?php echo form_error("tarif");?></div>
                    </div>
                </div>
                <div class="row">
                    <div class="col1">Tarif Tahunan</div>
                    <div class="col2"><input type="text" name="tariftahun" style="text-align:right" value="<?php foreach($price as $price1){
																				if($price1['keterangan']=="Tahunan"){
																					echo $price1['harga'];
																				}
																			 }?>"/> 
                        <div class="errorField"><?php echo form_error("tarif");?></div>
                    </div>
                </div>
			</div>
           </div>
           <div class="row">
            	<strong>Bertanda * harus diisi</strong>
               
			</div>
           <div class="row">
            	<div class="col1">Staff</div>
                <div class="col2"><?php echo get_username($this->session->userdata("user_id"));?> 
                	
                </div>
			</div>
           	<div class="row">
            	<div class="col1">Kode Supir</div>
                <div class="col2"><strong><?php echo $driverDet['0']['nid'];?></strong> 
                	<div class="errorField"><?php echo form_error("nama_supir");?></div>
                </div>
			</div>
           	<div class="row">
            	<div class="col1">Kategori</div>
                <div class="col2">
                	<select id="kategori" name="kategori">
                    	<option value="1" selected="selected">1</option>
                        <option value="2">2</option>
                        <option value="3">3</option>
                        <option value="4">4</option>
                        <option value="5">5</option>                    
                    </select> 
                </div>
			</div>
            <div class="row">
            	<div class="col1">Status</div>
                <div class="col2">
                	
                	<select id="status" name="status">
                    	<?php if($driverDet['0']['status']=="permanen"){?>
                        	<option value="permanen"selected="selected">Permanen</option>
                            <option value="oncall">Kontrak</option>
                        	<option value="freelance">Freelance</option>
                        <?php } elseif($driverDet['0']['status']=="oncall"){?>
                        	<option value="permanen">Permanen</option>
                            <option value="oncall" selected="selected">On Call</option>
                        	<option value="freelance">Freelance</option>
                        <?php }else{?>
                            <option value="permanen">Permanen</option>
                            <option value="oncall">On Call</option>
                        	<option value="freelance" selected="selected">Freelance</option>
                        <?php }?>        
                    </select> 
                </div>
			</div>
            <div class="row">
            	<div class="col1">Nama Depan *</div>
                <div class="col2"><input type="text" name="nama_supir" value="<?php echo $driverDet['0']['name'];?>"/> 
                	<div class="errorField"><?php echo form_error("nama_supir");?></div>
                </div>
			</div>
            <div class="row">
            	<div class="col1">Nama Belakang</div>
                <div class="col2"><input type="text" name="namabel" value="<?php echo $driverDet['0']['namabel'];?>"/> 
                	<div class="errorField"><?php echo form_error("namabel");?></div>
                </div>
			</div>
            <div class="row">
            	<div class="col1">Tempat Lahir</div>
                <div class="col2"><input type="text" name="temlahir" value="<?php echo $driverDet['0']['tempatlahir'];?>"/> 
                	<div class="errorField"><?php echo form_error("temlahir");?></div>
                </div>
			</div>
            <div class="row">
            	<div class="col1">Tanggal Lahir</div>
                <div class="col2">
                	<?php $tgl = explode("-", $driverDet['0']['tanggallahir']);?>
                	Tgl
                	<select id="tgl" name="tgl" style="width:20%">
                    	<?php for($i=1;$i<32;$i++){
                        	if($i==$tgl[2]){?>
                        		<option value="<?php if($i<10){echo 0;} echo $i;?>" selected="selected"><?php echo $i;?></option>
                            <?php }else{?>
                            	<option value="<?php if($i<10){echo 0;} echo $i;?>"><?php echo $i;?></option>
                            <?php } //end else
						} //end for?>                   
                    </select>
                    Bln 
                    <select id="bln" name="bln" style="width:20%">
                    	<?php for($i=1;$i<13;$i++){
                        	if($i==$tgl[1]){?>
                        		<option value="<?php if($i<10){echo 0;} echo $i;?>" selected="selected"><?php echo $i;?></option>
                            <?php }else{?>
                            	<option value="<?php if($i<10){echo 0;} echo $i;?>"><?php echo $i;?></option>
                            <?php } //end else
						} //end for?>                   
                    </select>
                    
                    Thn
                    <select id="thn" name="thn" style="width:26%">
                    	<?php for($i=date("Y")-80;$i<date("Y")-10;$i++){
                        	if($i==$tgl[0]){?>
                        		<option value="<?php echo $i;?>" selected="selected"><?php echo $i;?></option>
                            <?php }else{?>
                            	<option value="<?php echo $i;?>"><?php echo $i;?></option>
                            <?php } //end else
						} //end for?>                   
                    </select>
                    
                </div>
			</div>
        	
            <div class="row">
                    <div class="col1">Alamat</div>
                    <div class="col2"><input type="text" name="alamat"  value="<?php echo $driverDet['0']['alamat'];?>"/> 
                       
                    </div>
            </div>
         	<div class="row">
                <div class="col1">Email</div>
                <div class="col2"><input type="text" name="email"  value="<?php echo $driverDet['0']['email'];?>"/> 
                    
                </div>
            </div>
            <div class="row">
                <div class="col1">HP*</div>
                <div class="col2"><input type="text" name="no_telp"  value="<?php echo $driverDet['0']['telp'];?>"/> 
                    <div class="errorField"><?php echo form_error("no_telp");?></div>
                </div>
            </div>
            <div class="row">
                <div class="col1">Telepon Rumah</div>
                <div class="col2"><input type="text" name="telp_rmh"  value="<?php echo $driverDet['0']['telprumah'];?>"/> 
                    <div class="errorField"><?php echo form_error("telp_rmh");?></div>
                </div>
            </div>
        </div>
        <div class="title" align="right">
          	<input type="submit" name="btnSave" value="Save" class="button_red" />
        </div>
        <div class="success"><?php echo (isset($success))?$success:"";?>&nbsp;</div>

        </form>
    </div>
   
</div>
<?php $this->load->view("general/footer");?>